local Class = require('lua.lang.Class')

--- @class StringBuilder : Class
local StringBuilder = Class {}

--- @param s string
--- @return StringBuilder
function StringBuilder:new(s)
	--- @type StringBuilder
	local o = {}
	o.s = s or ''
	return setmetatable(o, StringBuilder)
end

--- @param s string
--- @return StringBuilder
function StringBuilder:append(s)
	self.s = self.s .. s
	return self
end

--- @return string
function StringBuilder:toString()
	return self.s
end

return StringBuilder
